package net.yla.smartbus.module.controller.web.ba.SendSMS;

import net.yla.smartbus.core.api.ApiResult;
import net.yla.smartbus.core.base.BaseController;
import net.yla.smartbus.module.ba.smsMessages.query.CaptchaQuery;
import net.yla.smartbus.module.ba.smsMessages.serivce.SmsMessagesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/web/captcha")
public class CaptchaController extends BaseController {

    @Autowired
    private SmsMessagesService smsMessagesService;

    /**
     * 清理历史验证码记录
     *
     * @param query
     * @return
     */
    @GetMapping("/clean")
    public ApiResult cleanCaptcha(CaptchaQuery query) {
        return success(smsMessagesService.cleanCaptcha(query));
    }
}
